<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>微店优惠券列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<link href="cxcalendar.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script language="javascript" src="../script/Calendar-new.js"></script>
<script type="text/javascript">
$(function(){
    /* 全选 */
     $('.checkall').click(function(){
        var _self = this;
        $('.checkitem').each(function(){
            if (!this.disabled)
            {
                $(this).attr('checked', _self.checked);
            }
        });
        $('.checkall').attr('checked', this.checked);
    });
})
</script>
</head>
<body>
<div class="container">
    <div class="flow">
        <div class="itemtitle">
            <h3>优惠券列表</h3>
            <ul>
                <li><a href="?m=micro_shop&s=coupons_package_list.php"><span>礼包列表</span></a></li>
            </ul>
        </div>
    </div>
    <div class="h35"></div>
    
    <form action="" method="get">
	    <input type="hidden" name="m" value="<{$smarty.get.m}>">
	    <input type="hidden" name="s" value="<{$smarty.get.s}>">
	    <table>
	        <tr>
	        	<td>会员：</td>
                <td>
                	<textarea name="member_id" placeholder="会员ID，支持逗号分隔的多个"><{$smarty.get.member_id}></textarea>
               	</td>
               	<td>名称：</td>
               	<td>
               		<select name="cpns_name">
		            	<option value="">---请选择---</option>
		            	<{foreach item=clist from=$configArr }>
		            		<option value="<{$clist.name}>"><{$clist.name}></option>
		            	<{/foreach}>
		            </select>
               	</td>
               	<td>状态：</td>
               	<td>
               		<select name="status">
               			<option value="">全部</option>
               			<option value="0" <{if $smarty.get.status=='0'}>selected<{/if}>>未使用</option>
               			<option value="1" <{if $smarty.get.status=='1'}>selected<{/if}>>已使用</option>
               			<option value="-1" <{if $smarty.get.status=='-1'}>selected<{/if}>>已禁用</option>
               		</select>
               	</td>
	            <td>
                	<input type="submit" value="搜索" />
            	</td>
	        </tr>
	    </table>
    </form>
    
    <form action="" method="post">
    <input type="hidden" name="m" value="<{$smarty.get.m}>">
	<input type="hidden" name="s" value="<{$smarty.get.s}>">
    <table class="table product">
       <tbody>
       <tr class="header">
       		<th width="30"></th>
            <th width="100">ID</th>
            <th width="100">名称</th>
            <th width="100">发放店铺</th>
            <th width="100">使用规则</th>
            <th width="100">有效期</th>
            <th width="100">优惠券编码</th>
            <th width="100">使用时间</th>
            <th width="100">订单ID</th>
            <th width="100">使用人</th>
            <th width="100">使用店铺</th>
            <th width="100">状态</th>
            <th width="100">操作</th>
        </tr>
        <{foreach item=list key=key from=$de.list}>
        <tr>
        	<td><input type="checkbox" value="<{$list.id}>" class="checkitem" name="chk[]" <{if $list.status==1}>disabled<{/if}>></td>
            <td><{$list.id}></td>
            <td><{$list.title}></td>
            <td>店铺ID:<{$list.member_id}><br />店铺名称:<{$list.shop_name}></td>
            <td>满<{$list.cpns_if}>减<{$list.cpns_then}></td>
            <td><{$list.start_time}><br/><{$list.end_time}></td>
            <td><{$list.cpns_key}></td>
            <td><{$list.use_time}></td>
            <td><{$list.order_id}></td>
            <td><{if $list.use_member_id}>用户ID:<{$list.use_member_id}><br />电话:<{$list.use_mobile}><{/if}></td>
            <td><{if $list.ms_id}>店铺ID:<{$list.ms_id}><br />店铺名称:<{$list.use_shop_name}><{/if}></td>
            <td>
            <{if $list.status==0}>未使用<{/if}>
            <{if $list.status==1}>已使用<{/if}>
            <{if $list.status==-1}>已禁用<{/if}>
            </td>
            <td>
            	<{if $list.status==0}><a onclick="return confirm('确定禁用吗');" href="?m=micro_shop&s=coupons_list.php&act=forbid&id=<{$list.id}>">禁用</a><{/if}>
            </td>
        </tr>
        <{foreachelse}>
        <tr>
            <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
        </tr>
        <{/foreach}>
		</tbody>
        <tfoot>
            <tr>
            	<td colspan="2">
                	<input type="checkbox" class="checkall">
                    <input type="hidden" name="act" value="op" />
                    <input type="submit" name="submit" value="禁用" />
                    <input type="submit" name="submit" value="解禁" />
            	</td>
                <td colspan="99">
                	<div class="fl">每页最多显示： <{$de.perPageRows}>条</div>
                    <div class="page"><{$de.page}></div>
                    <div class="fr">共有<{$de.count}>条记录</div>
                </td>
            </tr>
        </tfoot>
    </table>
    </form>
</div>
</body>
</html>